<?php
require_once("auth/sso.php");


$sso = new SingleSignOn_Broker();

if (!empty($_GET['logout'])) {
    $sso->logout();
} elseif ($sso->getInfo() || ($_SERVER['REQUEST_METHOD'] == 'POST' && $sso->login())) {
    header("Location:index.php", true, 303);
    exit;
}

if ($_SERVER['REQUEST_METHOD'] == 'POST') $errmsg = "Login failed";

?>

<html>
	<head>
		<title>Single Sign-On demo - Login</title>
       <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"/>

        <link href="css/application.css" media="screen" rel="stylesheet" type="text/css">
        <link href="css/dashboards.css" media="screen" rel="stylesheet" type="text/css">
                
        <!-- <link rel="stylesheet" type="text/css" href="../css/style.css" media="screen"/> -->
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
	</head>
	<body >
             <script src="http://code.jquery.com/jquery-latest.js"></script>
            <script src="js/bootstrap.min.js"></script>
		<!-- header -->
        <div id="root">
		<div id="wrapper">
			<div class="navbar navbar-fixed-top">
				<div class="navbar-inner">
					<div class="container">
						<a href="#" class="brand">Autogator</a>
						<ul class="nav pull-right">
                                                        <li id="dash-board">
								<a href="#">Single Sign On</a>
							</li>
						</ul>
						<!--<form class="navbar-search pull-left" id="vehicle-typeahead-form">
						<input autocomplete="off" class="search-query span2" data-provide="typeahead" data-source="[{&quot;id&quot;:8599,&quot;name&quot;:&quot;2006 acura&quot;}]" id="vehicle-typeahead" name="vehicle" placeholder="Search vehicles..." type="text">
						</form> -->
                                     </div>
			      </div>
	                 </div>
                    <div id="content">
			<div class="container">
                            <div class="block withsidebar">
                                <div class="block_head">
                                    
                                    <div class="bheadl"></div>
                                    <div class="bheadr"></div>
                                    <h2>Enter your User ID and Password to Sign in</h2>
                               </div>    
                               <div class="block_content"> 
                                   <div class="sidebar">
                                       <ul class="sidemenu">
                                           <li class="active"><a style="font-weight:normal;" href="#">Sign Up Now!</a></li>
                                           <li><a style="font-weight:normal; font-size: 12px;" href="#">Need Help?</a></li>
                                           <li><a style="font-weight:normal; font-size: 12px;" href="#">Modify your Account</a></li>
                                           <li><a style="font-weight:normal; font-size: 12px;" href="#">Synchronize your Password</a></li>
                                           <li><a style="font-weight:normal; font-size: 12px;" href="#">Forgot your User ID?</a></li>
                                           <li><a style="font-weight:normal; font-size: 12px;" href="#">Forgot your Password?</a></li>
                                       </ul>
                                   </div>
                                   <div class="sidebar_content">
                                       <div class="row-fluid">
                                           <div class="span6">
                                             <!-- <div class="sign-header-main">Enter your User ID & Password</div>
                                              <div class="sign-header-sub">Now that we've directed you to the optimal server, please enter your User ID & Password</div> -->
                                              <img src="images/log-car.jpg" style="width:100%;height:270px"/>
                                             
                                           </div>
                                            <div class="span6"> 
                                                <div class="well well-small">
                                                   
                                                   <form class="form-horizontal" id="sign-in-form" action="login.php" method="POST">
                                                        <legend>SSO Sign In</legend>
                                                      
                                                         <div class="control-group">
                                                             <div class="control-label"></div>
                                                             <div class="controls" style="text-align: left; margin-bottom: -12px;"> <?php if (isset($errmsg)): ?><div style="color:red;padding-left:7%;"><?php echo $errmsg ?></div><?php endif; ?></div>
                                                         </div>
                                                      <div class="control-group">
                                                            <label class="control-label" style="width: 20%;" for="username">User ID:</label>
                                                            
                                                            <div class="controls" style="margin-left: 100px;">
                                                                <input type="text" id="username" name="username" style="width: 70%;"></div>
                                                        </div>    
                                                        <div class="control-group">
                                                            <label class="control-label" style="width: 20%;" for="password">Password:</label>
                                                             <div class="controls" style="margin-left: 100px;"><input type="password" id="password" name="password" style="width: 70%;"></div>
                                                        </div> 
                   
                                                        <!--<input type="image" id="signin"  name="signin" src="../images/login-submit.png" onClick="document.getElementById('contacts-form').submit()"> -->
                                                        <input type="submit" value="Sign in" id="signin" class="btn" style="margin-left: 100px;" onClick="document.getElementById('contacts-form').submit()" />
                                                        <span class="help-block" style="margin-left: 100px;"><a style="font-size: 10px;" href="#">How to get access</a><br/><a style="font-size: 10px;" href="#">User ID FAQs</a></span>
                                                    </form> 
                                                   
                                                </div>
                                           </div>
                                       </div>
                                       <div class="row-fluid">
                                           <span class="help-block" style="font-size:80%">YOU HAVE ACCESSED A PRIVTE FACILITY. IF YOU ARE NOT AUTHORIZED TO USE THE FACILITY OR YOU HAVE BEEN INADVERTENTLY CONNECTED. PLEASE DISCONNECT NOW. 
INTERNATIONAL AND UNAUTHORIZED ACCESS TO THIS NETWORK AND THE DATA HERE IN IS PROHIBITED AND WILL BE SUBJECT TO PROSECUTION.</span>
                                       </div>
                                   </div>
                               </div>
                                <div class="bendl"></div> 
                                <div class="bendr"></div> 
                            </div>
                        </div>
                    </div>    
                </div>
           </div>
       <footer id="footer">
            <div class="container">
		<div class="row">
			<div class="span5">Copy Right 2012- All Right Reserved</div>
			<div class="span5"></div>
			<div class="span2"></div>
		</div>
	    </div>
       </footer>          
    </body>
</html>